﻿ 
#include <iostream>
#include <zipper/zipper.h>
#include <zipper/unzipper.h>
#include <zipper/tools.h>
#include <vector>
#include <fstream>
#include <ostream>
#include <string>
#include <map>
using namespace zipper;
#pragma comment(lib, "..\\x64\\Debug\\zipper.lib")
#pragma comment(lib, "..\\x64\\Debug\\zlib-c.lib")

int main()
{
     /*zipper::Zipper zipper("ziptest.zip");
    std::ofstream test1("test1.txt");
    test1 << "test file compression";
    test1.flush();
    test1.close();

    std::ifstream test1stream("test1.txt");

    zipper.add(test1stream, "test1.txt");

    test1stream.close();
    zipper.close();

    std::remove("test1.txt");*/
    
    try{zipper::Unzipper unzipper(R"(D:\soft\维护\console-unzip\GBCardBListNew.zip)");
        std::vector<zipper::ZipEntry> entries = unzipper.entries();
        for (auto entry : entries)
        {
            std::cout << entry.name << std::endl;
            unzipper.extractEntry(entry.name);
        }
		unzipper.close();
    }
    catch (const std::exception& e)
    {
        std::cerr << e.what() << std::endl;
	}
 	//unzipper.extractEntry("test1.txt");
    std::cout << "Hello World!\n";
} 